<script language="javascript">
	function back(){
		document.location="<?php echo site_url("dosen_matkul/index/" . $id); ?>";
	}
</script>
<?php
echo form_open("/nilai_mahasiswa/form_nilai/" . $id . "/" . $parameter, array("name"=>"form_nilai","id"=>"medic_form"));
if($parameter == FALSE){
	$nilai	= set_value("nilai");
	$matkul	= set_value("matkul");
	$semester	= set_value("semester");
	$matkul	= set_value("matkul");
} else {
	$nilai	= $value["NILAI"];
	$matkul	= $value["ID_MATA_KULIAH"];
	$tahun	= $value["ID_TAHUN_AJARAN"];
	$semester	= $value["SEMESTER"];
}
?>

<p>
	<label>Nilai</label>
	<input type="text" value="<?php echo $nilai; ?>" name="nilai">
	<?php echo form_error("nilai"); ?>
</p>
<p>
	<label>Nama Mata Kuliah</label>
	<select name="matkul">
		<option value="">-- Pilih Nama Mata Kuliah --</option>
		<?php
		foreach($qmatkul as $row){
		?>
		<option value="<?php echo $row["ID_MATA_KULIAH"]; ?>" <?php echo ($matkul == $row["ID_MATA_KULIAH"]) ? ("selected") : (""); ?>><?php echo $row["NAMA_MATA_KULIAH"]; ?></option>
		<?php
		}
		?>
	</select>
	<?php echo form_error("matkul"); ?>
</p>
<p>
	<label>Tahun</label>
	<select name="tahun">
		<option value="">-- Pilih Tahun Ajaran--</option>
		<?php
		foreach($qt_ajaran as $row){
		?>
		<option value="<?php echo $row["ID_TAHUN_AJARAN"]; ?>" <?php echo ($tahun == $row["ID_TAHUN_AJARAN"]) ? ("selected") : (""); ?>><?php echo $row["TAHUN_AJARAN"]; ?></option>
		<?php
		}
		?>
	</select>
	<?php echo form_error("tahun"); ?>
</p>
<p>
	<label>Semester</label>
	<select name="semester">
		<option value="">-- Pilih Semester --</option>
		<option value="1" <?php echo ($semester == 1) ? ("selected") : (""); ?>>Ganjil</option>
		<option value="2" <?php echo ($semester == 2) ? ("selected") : (""); ?>>Genap</option>
	</select>
	<?php echo form_error("semester"); ?>
</p>
<p>
	<input type="submit" class="btn btn-primary" id="submit" value="Simpan">
	<input type="reset" class="btn btn-primary" id="submit" value="Reset">
	<input type="button" class="btn btn-primary" id="submit" value="Kembali" onClick="back()">
</p>
<?php echo form_close(); ?>